package com.yiyuan.weixin.weixinOutservice.Iml;

import com.yiyuan.weixin.Common.GlobalConstant;
import com.yiyuan.weixin.utils.HttpUtil;
import com.yiyuan.weixin.weixinOutservice.dao.MenuServiceDao;
import com.yiyuan.weixin.weixinOutservice.service.AbsWeiXinService;
import com.yiyuan.weixin.weixinOutservice.service.WeiXinService;
import org.springframework.beans.factory.annotation.Autowired;

import java.awt.*;

/**
 * Created by admin on 2017/3/27.
 */
public class ImlMenuService extends AbsWeiXinService{

    MenuServiceDao menuServiceDao=new MenuServiceDao();

    /**********
     * 创建菜单
     * @param json  菜单json
     * @return
     */
    @Override
    public String createMenu(String json){
        String string=menuServiceDao.createMenu(json);
        System.out.println(string);
        return string;
    }

    /*****
     * 删除正在使用菜单
     * @return
     */
    @Override
    public String deleteMenu(){
        return HttpUtil.sendGet(GlobalConstant.delete_menu+GlobalConstant.ACCESS_TOKEN);
    }

    /********
     * 查询菜单
     * @return
     */
    @Override
    public String getMenu(){
        return HttpUtil.sendGet(GlobalConstant.get_menu+GlobalConstant.ACCESS_TOKEN);
    }
}
